//
//  SMCColor.m
//  SMCKit
//
//  Created by Ren JianSheng on 11-8-1.
//  Copyright 2011年 3gtv.net. All rights reserved.
//

#import "UIColor+QL.h"
#import "NSDictionary+QL.h"

NSString *const kSMCDarkBlueColor = @"004488";
NSString *const kSMCBlackColor = @"000000";
NSString *const kSMCBlueGreenColor = @"0095B6";
NSString *const kSMCGrayColor = @"8B8680";
NSString *const kSMCPacificBlueColor = @"009DC4";

@implementation UIColor(QL)


// 将16进制颜色值转化为UIColor
+(UIColor *)ql_colorWithHex:(NSString *)hexColor {
    return [UIColor ql_colorWithHex:hexColor alpha:1.0];
}

// 可以设置透明值
+(UIColor *)ql_colorWithHex:(NSString *)hexColor alpha:(CGFloat)alpha {
    unsigned int red, green, blue;
	NSRange range;
	range.length = 2;
	range.location = 0; 
	[[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&red];
	range.location = 2; 
	[[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&green];
	range.location = 4; 
	[[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&blue];
	return [UIColor colorWithRed:(float)(red/255.0f) 
                           green:(float)(green/255.0f)
                            blue:(float)(blue/255.0f) 
                           alpha:alpha];
}



@end
